package cn.chaohi.common;

import cn.chaohi.model.Result;

/**
 * 接口业务异常.
 * 
 * @author bobo
 *
 */
public class ApiException extends RuntimeException {

	/**
	 * 序列化.
	 */
	private static final long serialVersionUID = 1L;

	private Result result;

	/**
	 * 此构造方法用于处理app接口异常
	 * 
	 * @param codeEnum
	 */
	public ApiException(CodeEnum codeEnum) {
		super(codeEnum.getErrMsg());
		this.result = new Result(codeEnum);
	}

	/**
	 * 此构造方法用于处理对接异常
	 * 
	 * @param result
	 */
	public ApiException(Result result) {
		super(result.getErrMsg());
		this.result = result;
	}

	public Result getResult() {
		return this.result;
	}

}
